using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace LiveFrameworkExplorer
{
    public partial class InputBox : Form
    {
        public InputBox()
        {
            InitializeComponent();
        }

        public InputBox(string title, string message)
        {
            InitializeComponent();
            this.Text = title;
            this.lblMessage.Text = message;
        }

        public string Value
        {
            get { return txtLabel.Text; }
            set { txtLabel.Text = value; }
        }

        public char PasswordChar
        {
            get { return txtLabel.PasswordChar; }
            set { txtLabel.PasswordChar = value; }
        }

        private void btOk_Click(object sender, EventArgs e)
        {
            if (txtLabel.Text != "")
                this.DialogResult = DialogResult.OK;
            else
                MessageBox.Show("Empty value", "Live Framework Explorer",
                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        }

        private void dlgInputBox_Load(object sender, EventArgs e)
        {
            this.txtLabel.Focus();
        }
    }
}